<template>
	<view style="display: flex;flex-direction: column;padding-top: 4rpx;height: 100%;">
		<view class="" style="">
			<view class="" style="position: relative;">
				<view class="" v-if="list.length==0" style="position: absolute;margin: auto;top:300rpx;left: 0;right: 0;width: 300rpx;text-align: center;">
					<image  src="../../static/image/nodata1.png" mode="" style="width: 300rpx;height: 200rpx;"></image>
					暂无数据
				</view>
				<view class="content" v-for="(item,index) in list" :key="item.id">
					<view class="" style="text-align: right;">
						<image src="../../static/image/daishenhe.png" mode="" class="daishenhe"></image>
					</view>
					
					<view class="">
						<view class="uni-flex one-label" >
							<view class="title-text labelcolor">买家昵称</view>
							<view class="label-data">{{item.maijiaName}}</view>
						</view>
						<view class="uni-flex one-label" >
							<view class="title-text labelcolor">购物平台</view>
							<view class="label-data">{{item.pingtaiStr}}</view>
						</view>
						<view class="uni-flex one-label" >
							<view class="title-text labelcolor">购物账户</view>
							<view class="label-data">{{item.gouwu_zhanghao}}</view>
						</view>
						<view class="uni-flex one-label">
							<view class="title-text labelcolor" style="text-align: left;">支付佣金</view>
							<view class="label-data" style="color: #E54D42;">{{item.yongjin}}</view>
						</view>
						<view class="uni-flex one-label">
							<view class="title-text labelcolor" style="text-align: left;">推荐人提成</view>
							<view class="label-data" style="color: #E54D42;">{{item.shangjiafencheng==null?0:item.shangjiafencheng}}</view>
						</view>
						<view class="uni-flex one-label">
							<view class="title-text labelcolor" style="text-align: left;">团队管理费</view>
							<view class="label-data" style="color: #E54D42;">{{item.shangjiaguanlifei==null?0:item.shangjiaguanlifei}}</view>
						</view>
						<view class="uni-flex one-label">
							<view class="title-text labelcolor" style="text-align: left;">手机号</view>
							<view class="label-data">{{item.mobile}}</view>
						</view>
						
						<view class="uni-flex one-label">
							<view class="title-text labelcolor" style="text-align: left;padding-bottom: 30rpx;">收货地址</view>
							<view class="label-data">{{item.shouhuo_addr}}</view>
						</view>
					</view>
					<view class="uni-flex anniu">
						<view class="" style="flex: 1;color: #FF4D4D;" @tap="bohui(item.id,index)">驳回</view>
						<view class="" style="flex: 1;border-left: 1rpx solid #F2F2F2; color: #3291F8;" @tap="tongguo(item.id,index)">通过</view>
					</view>
					
				</view>
			</view>
		</view>
		<!-- <selfPopupDialog ref="selfPopupDialog" title="审核确认" message="请认证核对后，立即返款，请确认是否通过？" :confirmBtn="submit"></selfPopupDialog> -->	
		<u-modal v-model="showBohui" content="确定驳回该任务订单" title="驳回" confirm-color="#FF4D4D" :content-style="{'font-size':'35rpx'}" @confirm="confirmBohui" confirm-text="驳回" :show-title="false" :show-cancel-button="true"></u-modal>
		<u-modal v-model="showTongguo" content="确定通过该任务订单" title="通过"  :content-style="{'font-size':'35rpx'}" :show-title="false" confirm-text="通过" @confirm="confirmTongguo" :show-cancel-button="true"></u-modal>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showBohui:false,
				showTongguo:false,
				selected:"0",
				userId:uni.getStorageSync("token"),
				pageNo:1,
				pageSize:10000,
				taskMyStatus:1,
				list:[],
				tongguoId:null,
				bohuiId:null,
				tongguoIndex:null,
				bohuiIndex:null,
				taskId:null
			}
		},
		onLoad:function(parane){
			var that = this;
			that.taskId=parane.id;
			that.$util.nuiAjax(that.$jiekou.selectTaskMyList,{pageNo:that.pageNo,pageSize:that.pageSize,taskMyStatus:that.taskMyStatus,taskId:that.taskId},function(res){
				that["list"] = res.list;
			});
		},
		onPullDownRefresh() {
			var that =this;
			that.$util.nuiAjax(that.$jiekou.selectTaskMyList,{pageNo:that.pageNo,pageSize:that.pageSize,taskMyStatus:that.taskMyStatus,taskId:that.taskId},function(res){
				that["list"] = res.list;
				uni.stopPullDownRefresh();
			});
			
		},
		methods: {
			tongguo:function(id,index){
				this.showTongguo = true;
				this.tongguoIndex = index;
				this.tongguoId = id;
			},
			bohui:function(id,index){
				this.bohuiId = id;
				this.bohuiIndex = index;
				this.showBohui = true;
			},
			confirmBohui:function(){
				var that = this;
				that.$util.nuiAjax(that.$jiekou.bohuiRenuw,{taskMyId:that.bohuiId},function(res){
					if(res.result == "true"){
						uni.$emit("jianTingdaishenhe",{myTaskId:that.taskId});
						that.$refs.uToast.show({
							title: "驳回成功",
							duration:500,
							callback :function(){
								uni.navigateBack();
								that.list0.splice(that.bohuiIndex,1);
								
							}
						});
					}else{
						that.$refs.uToast.show({
							title: res.message,
							duration:500
						});
					}
				});
			},
			confirmTongguo:function(){
				var that = this;
				that.$util.nuiAjax(that.$jiekou.tongguoRenwu,{myTaskId:that.tongguoId},function(res){
					if(res.result == "true"){
						uni.$emit("jianTingdaishenhe",{myTaskId:that.taskId});
						that.$refs.uToast.show({
							title: "通过成功",
							duration:500,
							callback :function(){
								uni.navigateBack();
								that.list0.splice(that.tongguoIndex,1);
							}
						});
					}else{
						that.$refs.uToast.show({
							title: res.message,
							duration:500
						});
					}
				});
			}
			
		}
	}
</script>

<style lang="scss">
	.daishenhe{
		width: 136rpx;
		height: 56rpx;
	}
	.anniu{
		border-top: #F2F2F2 2rpx solid;
		font-size:28rpx;
		font-weight:400;
		color:rgba(51,51,51,1);
		line-height:40px;
		text-align: center;
		padding-top: 30rpx;
		padding-bottom: 30rpx;
	}
	page{
		background-color: $page-bg-color;
		height: 100%;
	}
	.one-label{
		padding-top: 20rpx;
		justify-content: space-between;
	}
	.labelcolor{
		color: #999999;
		text-align: left;
	}
	.hide{
		display: none;
	}
	.daohanglan{
		padding:24rpx 0 0 0;
		justify-content: space-around;
		background-color: $uni-text-color-inverse;
		// margin-top: 4rpx;
		margin-bottom: 18rpx;
		box-shadow:0px 8rpx 16rpx 0px rgba(246,247,248,1);
	}
	.selected{
		height:6rpx;
		background:$uni-color-primary;
		width: 100%;
		margin-top: 18rpx;
	}
	.text-selected{
		color:$uni-color-primary;
	}
	.text-no-selected{
		color:#191919;
	}
	.title-text{
		// width:112rpx;
		// height:40rpx;
		font-size:28rpx;
		font-weight:400;
		line-height:40rpx;
	}
	.content{
		padding: 0 30rpx 0 30rpx;
		margin-top: 20rpx;
		background-color: #FFFFFF;
	}
</style>



